package com.aaa.project.mapper;

import com.aaa.entity.OOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 订单信息 Mapper 接口
 * </p>
 *
 * @author zhangxuhui
 * @since 2023-02-03
 */
@SuppressWarnings("all")
public interface OOrderMapper extends BaseMapper<OOrder> {


    List<OOrder> findAll(String id,Integer zhuangtai);


    @Update("update o_order set state = #{state} where code = #{code} ")
    boolean updState(@Param("code") String code, @Param("state") Integer state);

    Object buyGoods(@Param("id") String id,@Param("id1") String id1);

    int cancle(String id);

    int delete(String code);


//支付
    public Integer updateOrder(@org.apache.ibatis.annotations.Param("code") String code );

    @Select("select * from o_order where code = #{code} and state = 0 ")
    List<OOrder> all(String code);

//    商家
    Page getAllOrderBybid(@Param("page") Page page, @Param("Bid")String bid, @Param("Orders")  OOrder order);
    List<Map<String,Object>> income(@Param("Bid") String bid);

}
